Installation
npm install --save @types/bytes
Summary
This package contains type definitions for bytes (https://github.com/visionmedia/bytes.js).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bytes.
declare function bytes(value: number, options?: bytes.BytesOptions): string;
declare function bytes(value: string): number;
declare namespace bytes {
type Unit = "b" | "gb" | "kb" | "mb" | "pb" | "tb" | "B" | "GB" | "KB" | "MB" | "PB" | "TB";
interface BytesOptions {
decimalPlaces?: number | undefined;
fixedDecimals?: boolean | undefined;
thousandsSeparator?: string | undefined;
unit?: Unit | undefined;
unitSeparator?: string | undefined;
}
function format(value: number, options?: BytesOptions): string;
function parse(value: string | number): number;
}
export = bytes;
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by Zhiyuan Wang, Rickard Laurin, and Florian Keller.